# listings/urls.py
from django.urls import path
from . import views # 从当前应用的 views.py 导入视图

app_name = 'listings' # 定义应用的命名空间，方便在模板中反向解析 URL

urlpatterns = [
    # 主页
    path('', views.home_view, name='home'),
    
    # 用户相关
    path('register/', views.register_view, name='register'),
    path('profile/', views.profile_view, name='profile'),
    path('my-skills/', views.my_skills, name='my_skills'),
    path('my-needs/', views.my_needs, name='my_needs'),
    
    # 技能相关
    path('skills/', views.skill_list, name='skill_list'),
    path('skills/create/', views.skill_create, name='skill_create'),
    path('skills/<int:pk>/', views.skill_detail, name='skill_detail'),
    path('skills/<int:pk>/edit/', views.skill_edit, name='skill_edit'),
    path('skills/<int:pk>/contact/', views.contact_provider, name='contact_provider'),
    
    # 需求相关
    path('needs/', views.need_list, name='need_list'),
    path('needs/create/', views.need_create, name='need_create'),
    path('needs/<int:pk>/', views.need_detail, name='need_detail'),
    path('needs/<int:pk>/edit/', views.need_edit, name='need_edit'),
    path('needs/<int:pk>/contact/', views.contact_requester, name='contact_requester'),
]